using System;
using System.Diagnostics;

namespace BusinessFramework
{
    public static class RuleDebugger
    {
        static RuleDebugger()
        {
            Enabled = true;
        }

        public static bool ThrowExceptionWhenNoNotifyPropertyChanged { get; set; }
        public static bool ClosureWarning { get; set; }

        public static bool Enabled { get; set; }
        private static void WriteLine(string info)
        {
            if (Enabled)
                Debug.WriteLine(info);
        }

        [Conditional("DEBUG")]
        public static void Info(string message)
        {
            WriteLine(message);
        }

        [Conditional("DEBUG")]
        public static void Info(string format, string text1, string text2)
        {
            Info(string.Format(format, text1, text2));
        }

        [Conditional("DEBUG")]
        public static void Warning(string message)
        {
            WriteLine(message);
        }

        [Conditional("DEBUG")]
        public static void Error(string message)
        {
            WriteLine(message);
        }
    }
}